<?php
$this->Html->addCrumb('Homepage Photos','/admin/homepagePhotos');
$this->Html->addCrumb('Add');
?>
<?php 
$this->Html->scriptStart(array('inline' => false));
echo '
      $(function(){
        $("#HomepagePhotoAdminAddForm").TWS_Form( {
          validate : {
          rules : {
            PhotoImagePath : {required : true, help : "Select a photo to upload"}
          }
          }});
        });
       ';
$this->Html->scriptEnd();
?>
<h1>Add Photo</h1>

<?php echo '<div id="actionLink">'.$this->Html->link('Back to list of Photos',array('action'=>'index','admin'=>true)).'</div>'; ?>

<?php echo $this->element('errors', array('errors' => isset($errors)? $errors : null)); ?>
<?php

echo $this->TWSForm->create('HomepagePhoto',  array(
    'inputDefaults' => array(
        'div' => array('class'=>'row')),
        'class'=>'inlineForm',
        'type'=>'file'));

echo $this->TWSForm->input('image_path', array('type'=>'file', 'label'=>'<span class="required">*</span>Upload photo', 'name'=>'HomepagePhotoImagePath'));
echo $this->TWSForm->input('caption', array('rows'=>'3','name'=>'HomepagePhotoCaption'));
echo $this->TWSForm->end( array("label"=>"Add", "class"=>"button"));


?>